﻿<UserControl x:Class="EpiNEXT.WPF.View.Pages.PrintViewer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:EpiNEXT.WPF;assembly=EpiNEXT.WPF"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="500"
             IsVisibleChanged="UserControl_IsVisibleChanged"
             >
    <Grid>

        <Grid.Background>
            <SolidColorBrush Color="Black" Opacity="0.2" />
        </Grid.Background>

        <Border Margin="20" Background="{StaticResource LightPanelBackgroundBrush}" BorderBrush="{StaticResource HighlightBrush}" BorderThickness="1">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <StackPanel Margin="0, 20, 20, 20" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button
                                    Content="Close"
                                    Command="{Binding TogglePrintPreviewCommand}"
                                    Width="90" Margin="0, 0, 0, 0" />
                </StackPanel>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <DockPanel Grid.Row="0" Grid.Column="1" Margin="8, 0, 0, 0" >
                        <TextBlock VerticalAlignment="Center" Foreground="{StaticResource VeryLightTextBrush}" Style="{StaticResource Heading1}">PRINT</TextBlock>
                    </DockPanel>

                    <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top" Height="Auto" Margin="2, 4, 2, 4">

                        <Button x:Name="btnFirst" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToFirstRecordCommand}" Style="{StaticResource NavButtonStyle}" IsEnabled="{Binding Path=MoveToFirstRecordCommand.CanExecute}">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="1" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Path Grid.Column="2" HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnFirst, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z">
                                        <Path.RenderTransform>
                                            <RotateTransform CenterX="6" CenterY="6" Angle="180" />
                                        </Path.RenderTransform>
                                    </Path>
                                    <Rectangle Grid.Column="0" Height="12" Width="2" Fill="{Binding ElementName=btnFirst, Path=Foreground}"></Rectangle>

                                </Grid>
                            </Button.Content>
                        </Button>

                        <Button x:Name="btnPrev" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToPreviousRecordCommand}" Style="{StaticResource NavButtonStyle}" IsEnabled="{Binding Path=MoveToPreviousRecordCommand.CanExecute}">
                            <Button.Content>
                                <Grid>
                                    <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnPrev, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z">
                                        <Path.RenderTransform>
                                            <RotateTransform CenterX="6" CenterY="6" Angle="180" />
                                        </Path.RenderTransform>
                                    </Path>
                                </Grid>
                            </Button.Content>
                        </Button>

                        <TextBox x:Name="tbox1" Margin="16, 0, 0, 0" MinWidth="38" VerticalAlignment="Center" Text="{Binding SelectedForm.RecordsView.CurrentPosition, Mode=OneWay, NotifyOnSourceUpdated=True, Converter={StaticResource PlusOneConverter}}"></TextBox>
                        <TextBlock Margin="6" VerticalAlignment="Center" Text="of" />
                        <TextBlock Margin="0, 0, 16, 0" VerticalAlignment="Center" DataContext="{Binding SelectedForm.RecordsView}" Text="{Binding Path=Count, Mode=OneWay, NotifyOnSourceUpdated=True}" />

                        <Button x:Name="btnNext" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToNextRecordCommand}" Style="{StaticResource NavButtonStyle}">
                            <Button.Content>
                                <Grid>
                                    <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnNext, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z"/>
                                </Grid>
                            </Button.Content>
                        </Button>

                        <Button x:Name="btnLast" Margin="8, 0, 8, 0" Command="{Binding Path=MoveToLastRecordCommand}" Style="{StaticResource NavButtonStyle}">
                            <Button.Content>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="1" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Path HorizontalAlignment="Center" Width="12" Height="12" Stretch="Fill" Fill="{Binding ElementName=btnLast, Path=Foreground}" Data="F1 M 30.0833,22.1667L 50.6665,37.6043L 50.6665,38.7918L 30.0833,53.8333L 30.0833,22.1667 Z" />
                                    <Rectangle Grid.Column="2" Height="12" Width="2" Fill="{Binding ElementName=btnLast, Path=Foreground}"></Rectangle>
                                </Grid>
                            </Button.Content>
                        </Button>
                    </StackPanel>
                </Grid>

                <DocumentViewer x:Name="documentViewer" Grid.Row="1" Background="{StaticResource LightPanelBackgroundBrush}">
                    <FixedDocument x:Name="document">

                    </FixedDocument>
                </DocumentViewer>
            </Grid>
        </Border>
    </Grid>
</UserControl>
